﻿<Window x:Class="Brjnk.GpxExplorer.UI.CoordinatesToClipboardWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:l="clr-namespace:Brjnk.GpxExplorer.Localization"
        Title="{l:Loc titleToCoordinatesWindow}"
        DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}"
        Deactivated="Window_Deactivated"
        SizeToContent="WidthAndHeight"
        WindowStyle="ToolWindow">
    <ItemsControl ItemsSource="{Binding Items}">
        <ItemsControl.Resources>
            <Style TargetType="Button">
                <EventSetter Event="Click" Handler="ButtonClicked" />
            </Style>
        </ItemsControl.Resources>
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Label Grid.Column="0" Content="{Binding}" />
                    <Button Grid.Column="1"
                            Command="{StaticResource StringToClipboardCommand}"
                            CommandParameter="{Binding}">
                        <Image Source="/Resources/Icons/Clipboard16.png" />
                    </Button>
                </Grid>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
</Window>